/*
 * Copyright (C) 2017 Pingan, Inc. All Rights Reserved.
 */

package com.pingan.haofang.searchcloud.api.facade;

import com.pingan.haofang.searchcloud.api.IndexDataPacket;
import com.pingan.haofang.searchcloud.api.StorageCluster;

/**
 * 索引数据导入门面
 *
 * @author zhangbi617
 * @date 2017-07-14
 */
public interface IndexDataPushFacade {
    /**
     * 持久化数据
     *
     * @param storageCluster     集群host
     * @param indexDataPacket    Index数据包
     * @param millisecondTimeOut 超时时间，单位毫秒
     * @param needRoute          是否需要route
     * @return
     */
    boolean repository(StorageCluster storageCluster, IndexDataPacket indexDataPacket, int millisecondTimeOut, boolean needRoute);

    /**
     * 获取字段的最大值
     *
     * @param storageCluster
     * @param indexName
     * @param fieldName
     * @return
     */
    Long getMaxValue(StorageCluster storageCluster, String indexName, String fieldName);
}
